/*
 * ikakeibo 0.6.0
 * Copyright (C)2009 wateray and contributors
 * wateray@gmail.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
package com.wateray.ipassbook.commom;

/**
 * @author wateray
 * 
 */
public class Constant {

	public static final String VERSION = "0.6";

	/** domain_name="com.wateray" */
	public static final String DOMAIN_NAME = "com.wateray";

	/** project_name="ipassbook" */
	public static String PROJECT_NAME = "ipassbook";

	/** package_root="com.wateray.ipassbook" */
	public static String PACKAGE_ROOT = DOMAIN_NAME + getDot() + PROJECT_NAME;

	/** protocol_file="file:" */
	public static final String PROTOCOL_FILE = "file:";

	/** LOG4J_FILE="settings/log4j.properties" */
	public static final String LOG4J_FILE = "settings/log4j.properties";

	/** setting="settings" */
	public static final String SETTINGS = "settings";

	/** package_resourse="com.wateray.ipassbook.resource" */
	public static String PACKAGE_RESOURSE = PACKAGE_ROOT + getDot()
			+ "resource";

	/** package_image="com.wateray.ipassbook.resource.image" */
	public final static String PACKAGE_IMAGE = PACKAGE_RESOURSE + getDot()
			+ "image";

	/** package_i18n="settings.i18n" */
	public final static String PACKAGE_I18N = "settings" + getDot() + "i18n";

	/** i18n_bundle_name="settings.i18n.appBundle" */
	public static final String I18N_BUNDLE_NAME = PACKAGE_I18N + getDot()
			+ "appBundle";

	// database.properties
	/**
	 * database_properties=
	 * "com/wateray/ipassbook/resource/image/database.properties"
	 */
	public static final String DATABASE_PROPERTIES = dotToSlash(PACKAGE_RESOURSE)
			+ getSlash() + "database.properties";

	/** database_file="data/ikakeibo.dat" */
	public static final String DATABASE_FILE = "data" + getSlash()
			+ "ikakeibo.dat";

	/** database_url="jdbc:sqlite:data/ikakeibo.dat" */
	public static final String DATABASE_URL = "jdbc:sqlite:" + DATABASE_FILE;

	// icon info
	/** icon_url="com/wateray/ipassbook/resource/image" */
	public static String ICON_DIR = dotToSlash(PACKAGE_IMAGE);

	/** app_icon="com/wateray/ipassbook/resource/image/gnome.png" */
	public static String APP_ICON = ICON_DIR + getSlash() + "gnome.png";

	/** temp_dir="temp" */
	public static final String TEMP_DIR = "temp";

	/** Image Height at context information panel. */
	public static final int CONTEXT_INFORMATION_IMAGE_HEIGHT = 75;

	public static String dotToSlash(String oldString) {
		return oldString.replace(getDot(), getSlash());
	}

	/**
	 * @return "."
	 * */
	public static String getDot() {
		return ".";
	}

	/**
	 * @return "/"
	 * */
	public static String getSlash() {
		return "/";
	}

	public final static String INCOME_KBN = "1"; // 收入区分
	public final static String EXPENSE_KBN = "-1"; // 支出区分
	public final static String MIN_DAY = "1900-01-01"; // 一番小さい日付
	public final static String MAX_DAY = "9999-12-31"; // 一番小さい日付

	/**
	 * enmu <b>Type</b> Type.ADD; Type.MoDIFY; Type.DELET.
	 * */
	public enum Type {
		/** Add Receipt. */
		ADD,
		/** Modify Receipt. */
		MODIFY,
		/** Delete Receipt. */
		DELETE;
	}
	
	/**
	 * Name of the Linux / Solaris command
	 */
	public static final String COMMAND_LINUX_SOLARIS = "ipassbook.sh";

	/**
	 * Name of the MacOsX command
	 */
	public static final String COMMAND_MACOSX = "ipassbook.command";
	
	/**
	 * Name of the Windows command
	 */
	public static final String COMMAND_WINDOWS = "ipassbook.jar";
	
	
	//mouse
	public static final int LEFT_CLICK = 1;
	public static final int MIDDLE_CLICK = 2;
	public static final int RIGHT_CLICK = 3;

	public static final int DOUBLE_CLICK = 2;
	


}
